<?php
declare (strict_types=1);

namespace app\admin\validate;

use think\Validate;

class InserUser extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'account' => 'require|max:25',
        'age' => 'number|between:1,120',
        'email' => 'email',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'account.require' => '名称必须',
        'account.max' => '名称最多不能超过25个字符',
        'age.number' => '年龄必须是数字',
        'age.between' => '年龄必须在1~120之间',
        'email' => '邮箱格式错误',
    ];
}
